package com.qt.thread.queue;

import com.qt.thread.scxf.Desk;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * @Author zsf
 * @Date 2023/10/3 14:50
 * @Version 1.0
 */
public class CookerQueue extends Thread {

    private ArrayBlockingQueue queue;

    public CookerQueue() {
    }

    public CookerQueue(String name) {
        super(name);
    }

    public CookerQueue(String name, ArrayBlockingQueue queue) {
        super(name);
        this.queue = queue;
    }

    @Override
    public void run() {

        while (true){

            try {
                queue.put("包子");
                System.out.println(getName() + " 做包子");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }


        }


    }
}
